from django import forms
from artSightWorld.apps.base.models import *
from django.forms.extras.widgets import SelectDateWidget 

class AddAlbumForm(forms.Form):
	nom = forms.CharField(max_length=100, label="Nom")
	
class AddPhotosForm(forms.Form):
	def __init__(self, *args, **kwargs):
		super(AddPhotosForm, self).__init__(*args, **kwargs)
		self.fields.insert(len(self.fields)-1, 'album', forms.ModelChoiceField(queryset=Album.objects.filter(photographer__id=self.initial['userId']), empty_label=None, label="Album"))

	titre = forms.CharField(max_length=100, label="Titre*")
	dateTaken = forms.DateField(widget=SelectDateWidget(years=range(1980, 2013)), label="Date de prise")
	caption = forms.CharField(widget=forms.Textarea, required=False, label="Legende")
	city = forms.CharField(required=False, label="Ville*")
	city_id = forms.IntegerField(widget=forms.HiddenInput())
	

	image  = forms.ImageField(label="Photo")